package com.hch.dao;

import com.hch.domain.Type;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;

import java.util.List;

public interface TypeRepository extends JpaRepository<Type, Long> {

    Type findTypeByName(String name);

    //通过分页中的排序拿到不同分类对应标签的个数
    @Query("select t from Type  t ")
    List<Type> findTopType(Pageable pageable);
}
